package com.daohang361.imqq.decoder;

import com.daohang361.imqq.Asycore.QQUser;
import com.daohang361.imqq.tool.Hex2Bytes;
import com.daohang361.imqq.tool.MyByteReciveArray;
/**
 * 解析012C
 * @author naner
 *
 */
public class Decoder012C implements InterfaceDecoder {
	private MyByteReciveArray myArray;
	private QQUser sessionQQ;
	@Override
	public void init(MyByteReciveArray myArray, QQUser sessionQQ) {
		this.myArray=myArray;
		this.sessionQQ=sessionQQ;
	}

	@Override
	public QQUser decode() throws Exception {
		myArray.decryptRemain(sessionQQ.getAttr("SessionKey"));
	System.out.println("012C:"+Hex2Bytes.bytesToHexString(myArray.extract(0, 30)));
		sessionQQ.setLogintimes(sessionQQ.getLogintimes()+1);//登陆包前进
		sessionQQ.setPakage(sessionQQ.getPakage()+1);//登陆包自动增长
		return sessionQQ;
	}

	@Override
	public Object invoke(Object... o) {
		// TODO Auto-generated method stub
		return null;
	}

}
